package liy.demo.wikiproject.exception;

import lombok.Data;
import org.springframework.stereotype.Component;

public class BookException extends RuntimeException{

    public BookExceptionCode getCode() {
        return code;
    }

    public void setCode(BookExceptionCode code) {
        this.code = code;
    }

    private BookExceptionCode code;

    public BookException(BookExceptionCode code) {
        super(code.getDesc());
        this.code = code;
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}
